<%-- 
    Document   : view-odc-graph
    Created on : Apr 12, 2011, 4:29:06 AM
    Author     : bayu
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <jsp:include page="includes/script.html"/>
    </head>
    <body>
        <center>
         <form method="get">

           From : <input type="text" value="${start}" name="start" readonly> <img src="images/calendar.gif" onclick="displayDatePicker('start', false, 'ymd', '-');" />&nbsp;
             To : <input type="text" value="${end}" name="end" readonly> <img src="images/calendar.gif" onclick="displayDatePicker('end', false, 'ymd', '-');" />&nbsp;
               <input  type="submit" name="submit" value="View" >

        </form>
        </center>
        <br>
        <br>
        <center>
            <a href="odcgraph-big.png"><img src="odcgraph.png" width="800" border="0" alt="ODC Graph"></a>
            <br>
            <br>
            <c:set var="actTotal" value="0" />
            <c:set var="planTotal" value="0" />
            <c:set var="actTotal" value="0" />
            <c:set var="planComp" value="0" />
            <c:set var="actComp" value="0" />
            <c:set var="balancePF" value="0" />
            <c:set var="balanceTotal" value="0" />

            <table bgcolor="#000000" width="1000" cellpadding="1" cellspacing="1" border="0">
                <tr bgcolor="#FFFFFF">
                    <td width="3%">Date</td>

                        <c:forEach var="data" items="${data}">
                            <td width="2%">
                                <fmt:formatDate pattern="dd" value="${data.date}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>

                        <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               Forc &nbsp; <fmt:formatDate pattern="MMM" value="${forc.date}" />
                            </td>
                        </c:forEach>

                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Plan 4W</td>
                    <c:forEach var="data" items="${data}">
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.plan4w}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                        <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Plan 2W</td>
                    <c:forEach var="data" items="${data}">
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.plan2w}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Plan IP</td>
                    <c:forEach var="data" items="${data}">
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.planip}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Plan Export</td>
                    <c:forEach var="data" items="${data}">
                            <td width="2%">
                               <fmt:formatNumber maxFractionDigits="2" value="${data.planexport}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Plan P/F</td>
                    <c:forEach var="data" items="${data}">
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.planpf}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Plan Total</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.plan4w + data.plan2w + data.planexport + data.planip + data.planpf}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               <fmt:formatNumber maxFractionDigits="2" value="${forc.avgforce}" />
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Act 4W</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.act4w}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Act 2W</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.act2w}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Act IP</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.actip}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Act Export</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.actexport}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Act P/F</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.actpf}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Act Total</td>
                    <c:forEach var="data" items="${data}">

                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.act4w + data.act2w + data.actip + data.actexport + data.actpf}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Balance Comp</td>
                     <c:forEach var="data" items="${data}">
                         <c:set var="planComp" value="${data.plan4w + data.plan2w + data.planip + data.planexport}" />
                         <c:set var="actComp" value="${data.act4w + data.act2w + data.actip + data.actexport}" />
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${actComp - planComp}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Balance P/F</td>
                    <c:forEach var="data" items="${data}">
                         
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${data.actpf - data.planpf}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
                <tr bgcolor="#FFFFFF">
                    <td>Balance Total</td>
                     <c:forEach var="data" items="${data}">
                         <c:set var="planTotal" value="${data.plan4w + data.plan2w + data.planip + data.planexport + data.planpf}" />
                         <c:set var="actTotal" value="${data.act4w + data.act2w + data.actip + data.actexport + data.actpf}" />
                            <td width="2%">
                                <fmt:formatNumber maxFractionDigits="2" value="${actTotal - planTotal}" />
                            </td>
                        </c:forEach>
                            <td width="2%">
                                &nbsp;
                            </td>
                            <c:forEach var="forc" items="${forc}">
                            <td width="2%">
                               &nbsp;
                            </td>
                        </c:forEach>
                </tr>
            </table>

        </center>
    </body>
</html>
